#ifndef ROD_H
#define ROD_H

#include "Object3D.h"
#include <QVector>
#include "Vector.h"
#include "Matrix.h"

class Rod : public Object3D
{
    QVector<QVector3D> posicoes;
    QVector<QVector3D> velocidades;
    QVector<float> l;
    QVector3D G;

    float dt;
    float dm;
    //float l;

public:
    Rod(float totalMass, const QVector3D& center = QVector3D(),
        QObject *parent = 0);

    virtual void drawGeometry(void);

    void temporalIntegration();

private:
    Vector getC(const QVector<QVector3D> &x);
    Matrix getGradC(const QVector<QVector3D> &x);
    void fastManifoldProjectionVelocityFilter();
    QVector<QVector3D> fromVectorToQVector3D(const Vector& v);
};

#endif // ROD_H
